#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>

int main()
{
	struct stat buf;
	stat("a.txt",&buf);
	printf("%o\n",buf.st_mode & 0777);
	printf("size = %d\n",buf.st_size);
	chmod("a.txt", 0666);
	truncate("a.txt",200);
	stat("a.txt",&buf);
	printf("%o\n",buf.st_mode & 0777);
	printf("size = %d\n",buf.st_size);
}
